import java.util.HashMap;
import java.util.Map;


/**
'CREATE TABLE lager (id int, barcode int, name VARCHAR(20), status VARCHAR(20), station VARCHAR(20), understation VARCHAR(20), stationinfo VARCHAR(20), reserviert TINYINT, reserviertvon VARCHAR(20), regal VARCHAR(20), bestand int, bestellt int, info VARCHAR(20));'
'CREATE TABLE artikel (id int, name VARCHAR(20), bestand int, beschreibung VARCHAR(20));'
'CREATE TABLE waren (id int, barcode int, status VARCHAR(20), wareneingangsId int, menge int);'
'CREATE TABLE stationen (barcode int, date datetime, user VARCHAR(20), station VARCHAR(20), substation VARCHAR(20), container VARCHAR(20));'




addWare( map )
changeStation ( map )
map showWare(barcode)
deleteWare(barcode)


'CREATE TABLE stationen (barcode int, date datetime, user VARCHAR(20), station VARCHAR(20), substation VARCHAR(20), container VARCHAR(20), regal VARCHAR(20));'
'CREATE TABLE waren (id int, barcode int, status VARCHAR(20), wareneingangsId int, menge int, lieferant VARCHAR(20), reserviertvon VARCHAR(20), reserviert TINYINT, info VARCHAR(20), bestellt int);'
*/




public class testClass {


	public static void main(String[] args) {
	
		
		Connector connector = new Connector();
		//connector.deleteAllArtikel();
		Artikel art1 = new Artikel();
		art1.setId(1234);
		art1.setBestand(0);
		art1.setName("Getriebe");
		//connector.addArtikel(art1);
		Artikel art2 = new Artikel();
		art2.setId(5678);
		art2.setBestand(0);
		art2.setName("Welle");
		//connector.addArtikel(art2);

		
		Map<String, String> map = new HashMap<String, String>();
		map.put("id", "1234");
		map.put("barcode", "1002");
		map.put("wareneingangsId","9997");
		map.put("station", "Lager");			
		map.put("menge", "1");	
		map.put("substation", "Lager 1");
		map.put("status", "angekommen");
		map.put("user", "Peters");
		map.put("regal", "B32");
		map.put("lieferant", "ZF");
		map.put("reserviert", "true");
		map.put("reserviertvon", "Stromberg");
		map.put("container", "Palette");
		map.put("bestellt", "3");
		map.put("info", "7-Gang");
		   
		
		
		
		
		
		Map<String, String> map2 = new HashMap<String, String>();
	
		
		map2.put("id", "1234");
		map2.put("barcode", "1002");
		map2.put("wareneingangsId","9997");
		map2.put("station", "Lager");			
		map2.put("menge", "1");	
		map2.put("substation", "Lager 2");
		map2.put("status", "angekommen");
		map2.put("user", "Himmler");
		map2.put("regal", "C4");
		map2.put("lieferant", "ZF");
		map2.put("reserviert", "true");
		map2.put("reserviertvon", "Stromberg");
		map2.put("container", "Palette");
		map2.put("bestellt", "3");
		map2.put("info", "7-Gang");
		
		Map<String, String> map3 = new HashMap<String, String>();
		map3.put("barcode", "1002");
		map3.put("status", "Dei Oma");
		map3.put("info", "stinkt");
		
		Map<String, String> map4 = new HashMap<String, String>();
		map4.put("id", "1234");
		map4.put("barcode", "1001");
		map4.put("station", "Lager");	
		map4.put("substation", "Lager 2");
		map4.put("status", "im Lager");
		map4.put("user", "Mueller");
		map4.put("container", "Karton");
		map4.put("regal", "B35");
		
		//connector.changeStatus(1000, "angekommen");
		//connector.changeStation(map2);
	   // connector.addWare(map);
		//connector.updateDatabase(map3);
		
	//	connector.changeStation(map2);
		//System.out.println(map3.get("barcode"));
		
		//connector.deleteWare(1);
		showMap(connector.showWare(1001));
		//System.out.println("\n");		
		//showMap(connector.showWare(2));
		
		
		//connector.listTable3();
		//System.out.println("\n");
		//showMap(connector.showWare(1001));
		//showMap(connector.showWarenachWeID(9998));
		//connector.changeStation(map);
		//showMap(connector.showWarenachWeID(9999));
		
		//System.out.println(connector.showAllStations(1000));
		//connector.deleteArtikel(12345);
		//connector.deleteAllArtikel();
		//connector.changeStatus(5, "verkauft");
		System.out.println("");
		connector.listTable();
		//showMap(connector.showWare(5));
		
		//System.out.println(connector.showAllStations(1000));
		
	}
	
	static void showMap(Map<String, String> map){
		System.out.println("ID : " +  map.get("id"));
		System.out.println("Name : " +  map.get("name"));
		System.out.println("Barcode : " +  map.get("barcode"));
		System.out.println("Station : " +  map.get("station"));
		System.out.println("Substation : " +  map.get("substation"));
		System.out.println("Regal : " +  map.get("regal"));
		System.out.println("Container : " +  map.get("container"));
		System.out.println("Wareneingangs ID : " +  map.get("wareneingangsId"));
		System.out.println("Menge : " +  map.get("menge"));
		System.out.println("Status : " +  map.get("status"));
		System.out.println("User : " +  map.get("user"));	
		System.out.println("Datum : " +  map.get("date"));
		System.out.println("Lieferant : " +  map.get("lieferant"));
		System.out.println("Reserviert von : " +  map.get("reserviertvon"));
		System.out.println("Reserviert : " +  map.get("reserviert"));
		System.out.println("Bestellt : " +  map.get("bestellt"));
		System.out.println("Info : " +  map.get("info"));
		System.out.println("Historie :\n" +  map.get("historie"));	
	}

}
